import request from '@/utils/request'

export default {
  cmList(params) {
    return request({
      url: '/v1/cmList',
      method: 'get',
      params
    })
  },
  getOne(id) {
    return request({
      url: `/v1/cm/${id}`,
      method: 'get'
    })
  },
  update(data) {
    return request({
      url: '/v1/cmUpdate',
      method: 'post',
      data
    })
  },
  create(data) {
    return request({
      url: '/v1/cmAdd',
      method: 'post',
      data
    })
  },
  archives(data) {
    return request({
      url: '/v1/cmArchive',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: `/v1/cmDel/${id}`,
      method: 'get'
    })
  },
  review(data) {
    return request({
      url: '/v1/cmReview',
      method: 'post',
      data
    })
  },
  appendParts(data) {
    return request({
      url: '/v1/cmAppendParts',
      method: 'post',
      data
    })
  },
  removeParts(data) {
    return request({
      url: '/v1/cmRemoveParts',
      method: 'post',
      data
    })
  },
  editParts(data) {
    return request({
      url: '/v1/cmEditParts',
      method: 'post',
      data
    })
  },
  needParts(data) {
    return request({
      url: '/v1/cmNeedParts',
      method: 'post',
      data
    })
  },
  wxCm(data) {
    return request({
      url: '/v1/cmWx',
      method: 'post',
      data
    })
  },
  engineerCm(data) {
    return request({
      url: '/v1/cmEngineer',
      method: 'post',
      data
    })
  },
  out(id) {
    return request({
      url: `/v1/cmToOut/${id}`,
      method: 'get'
    })
  }
}
